import {
	commonStatus,
	achievementCode,
	pickerOptions,
	format,
	formatDistanceTime,
	getNextMonthDay,
	getPreMonthDay,
	getNextDay,
	getPreDay,
	getCurrentTime,
	getValueByKey,
	getSingleValueByKey,
	getMutilValueByKey,
	createListByTree,
	convertCurrency,
	convertToChinaNum,
	formatDecimal,
	deepClone,
	toDecimal2NoZero,
	throttle,
	debounce,
	routerPath,
	hasRole, hasPost,
	hasCurrentRole,
	hasPermi,
	strDefault,
	hideMobile,
	computingTime
} from '@/utils/yh-Utils/funcLib/func.js'

import {
	checkPhone,
	checkEmail,
	checkUrl,
	jsonString,
	isEmpty,
	isArray,
	isObject,
	htmlEncodeByRegExp,
	htmlDecodeByRegExp
} from '@/utils/yh-Utils/funcLib/checkFunc.js'

const install = Vue => {

	Vue.filter('strDefault', (str, value) => {
		return strDefault(str, value)
	})

	Vue.filter('hideMobile', (mobile) => {
		return hideMobile(mobile)
	})
	Vue.prototype.$yhFunc = {
		commonStatus,
		achievementCode,
		pickerOptions,
		format,
		formatDistanceTime,
		getNextMonthDay,
		getPreMonthDay,
		getNextDay,
		getPreDay,
		getCurrentTime,
		getValueByKey,
		getSingleValueByKey,
		getMutilValueByKey,
		createListByTree,
		convertCurrency,
		convertToChinaNum,
		formatDecimal,
		deepClone,
		toDecimal2NoZero,
		throttle,
		debounce,
		routerPath,
		hasRole, hasPost,
		hasCurrentRole,
		hasPermi,
		strDefault,
		hideMobile,
		checkPhone,
		checkEmail,
		checkUrl,
		jsonString,
		isEmpty,
		isArray,
		isObject,
		htmlEncodeByRegExp,
		htmlDecodeByRegExp,
		computingTime
	}
}

export default {
	install
}


